package br.usp.ime.protoc.client;

import java.util.List;

import br.usp.ime.protoc.pessoa.Endereco;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public interface EnderecoService extends RemoteService {

    /**
     * Utility class for simplifying access to the instance of async service.
     */
    public static class Util {

        private static EnderecoServiceAsync instance;

        public static EnderecoServiceAsync getInstance() {
            if (instance == null) {
                instance = (EnderecoServiceAsync) GWT.create(EnderecoService.class);
                ServiceDefTarget target = (ServiceDefTarget) instance;
                target.setServiceEntryPoint(GWT.getModuleBaseURL() + "/EnderecoService");
            }
            return instance;
        }
    }

    /**
     * Obter Enderecos.
     */
    public List<Endereco> obterEnderecos();

    /**
     * Incluir Endereco.
     */
    public Boolean incluirEndereco(Endereco endereco);

    /**
     * Alterar Endereco.
     */
    public Boolean alterarEndereco(Endereco endereco);

    /**
     * Excluir Endereco.
     */
    public Boolean excluirEndereco(Endereco endereco);

}
